package br.edu.ufcg.msnlab2.grupo02.booleSimpson;

import br.edu.ufcg.msnlab2.misc.Function;
import br.edu.ufcg.msnlab2.misc.NumericalIntegrationMethod;

public class SimpsonsRule implements NumericalIntegrationMethod {

	@Override
	public double integrate( Function f, double a, double b ) {
		return ( b - a ) / 6 * ( f.evaluate( a ) + 4 * f.evaluate( ( a + b ) / 2 ) + f.evaluate( b ) );
	}

}
